package com.yxy.mapper;

import com.github.pagehelper.Page;
import com.yxy.pojo.dto.PageRemarkQueryDTO;
import com.yxy.pojo.dto.TypeDTO;
import com.yxy.pojo.entity.Remark;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RemarkMapper {

    /**
     * 写短评
     * @param remark
     */
    void writeReviews(Remark remark);

    /**
     * 获取短评
     * @param pageRemarkQueryDTO
     * @return
     */
    @Select("select * from remark where type = #{type} and type_id = #{typeId}")
    Page<Remark> getReviews(PageRemarkQueryDTO pageRemarkQueryDTO);
}
